import BindModel from './bindModel';
import BindAction from './bindAction';
import renderComponent from './render';
import {setData, getData} from './data';

let bindModel = BindModel(setData, getData);
let bindAction = BindAction(setData, getData);
let render = renderComponent(setData, getData);

const getInstance = (type) => {
    return (modelName) => {
        if (modelName) {
            return getData(type)[modelName];
        }
        return null;
    }
}

const getModel = getInstance('modelInstance');
const getAction = getInstance('actionInstance');

export {
    bindModel,
    bindAction,
    render,
    getModel,
    getAction
}